package untiring.services;

import java.util.List;

import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import untiring.interfaces.BoardDAO;
import untiring.interfaces.BoardService;
import untiring.interfaces.MemberDAO;
import untiring.interfaces.MemberService;
import untiring.interfaces.OrderDAO;
import untiring.interfaces.OrderService;
import untiring.models.BoardVO;
import untiring.models.CartVO;
import untiring.models.MemberVO;
import untiring.models.OrderVO;

@Service("orderService") 
public class OrderServiceImpl implements OrderService{

	@Autowired
	private OrderDAO orderDAO;
	
	
	@Override
	public String newOrder(OrderVO p) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<OrderVO> readOrder() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public OrderVO readOneOrder(String pno) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String modifyOrder(OrderVO p) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String removeOrder(String pno) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public byte[] viewImage(OrderVO p, HttpServletResponse res)
			throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String newCart(CartVO c) {
		String result = "mypage/mycart";
		if (orderDAO.insertCart(c))
			result = "redirect:/mypage/mypage.mvc";
		return result;
	}
	
	@Override
	public List<CartVO> readCart() {
		return orderDAO.selectCart();
	}


}
